package com.linkage.lcims.base.dao.business.impl;

import java.util.List;
import java.util.Map;

import com.linkage.lcims.base.dao.HibernateBaseDAOImpl;
import com.linkage.lcims.base.dao.business.interfaces.TollPolicySuitDAO;
import com.linkage.lcims.base.po.business.BdTollPolicySuit;
import com.linkage.lcims.base.po.business.BdTollPolicySuitPK;
import com.linkage.util.exception.DAOException;

public class TollPolicySuitDAOImpl extends HibernateBaseDAOImpl implements
		TollPolicySuitDAO {

	private static final String PO_CLASS = "com.linkage.lcims.base.po.business.BdTollPolicySuit";
	
	public TollPolicySuitDAOImpl() {
		// TODO Auto-generated constructor stub
	}

	public BdTollPolicySuit getTollPolicySuit(BdTollPolicySuit bdTollPolicySuit)
			throws DAOException {
		// TODO Auto-generated method stub
		return (BdTollPolicySuit)this.getByID(BdTollPolicySuit.class, bdTollPolicySuit.getComp_id());
	}

	public void saveTollPolicySuit(BdTollPolicySuit bdTollPolicySuit)
			throws DAOException {
		// TODO Auto-generated method stub
		this.save(bdTollPolicySuit);
	}

	public void updateTollPolicySuit(BdTollPolicySuit bdTollPolicySuit)
			throws DAOException {
		// TODO Auto-generated method stub
		this.merge(bdTollPolicySuit);
	}

	public void deleteTollPolicySuit(BdTollPolicySuit bdTollPolicySuit)
			throws DAOException {
		// TODO Auto-generated method stub
		this.delete(bdTollPolicySuit);
	}

	public void updateFields(BdTollPolicySuitPK id, Map<String,Object> fieldValues) throws DAOException {
		// TODO Auto-generated method stub
		this.updateField(PO_CLASS, id, fieldValues);
	}

	@SuppressWarnings("unchecked")
	public List<BdTollPolicySuit> getAll() throws DAOException {
		// TODO Auto-generated method stub
		return super.getAll(BdTollPolicySuit.class);
	}

//	public List<BdTollPolicySuit> getTollPolicySuitList(BdTollAttrPolicy bdTollAttrPolicy)
//			throws DAOException {
//		// TODO Auto-generated method stub
//		String hql = "from BdTollPolicySuit as policySuit where policySuit.comp_id.policyid="+bdTollAttrPolicy.getComp_id().getPolicyid()+" and policySuit.comp_id.recordid="+bdTollAttrPolicy.getComp_id().getRecordid();
//		return this.query(hql);
//	}

}
